package com.qf.main.pharmacy.controller;

import com.github.pagehelper.PageInfo;
import com.qf.common.base.result.ResponseResult;
import com.qf.main.pharmacy.common.qo.AuditQo;
import com.qf.main.pharmacy.common.qo.StorageQo;
import com.qf.main.pharmacy.common.vo.AuditVo;
import com.qf.main.pharmacy.common.vo.StorageVo;
import com.qf.main.pharmacy.service.AuditService;
import com.qf.main.pharmacy.service.StorageService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author chengqiang
 * @Create 2024-03-03-18:09
 * @Description:
 */
@RestController
@RequestMapping("/storage")
@CrossOrigin
@Api(tags = "入库管理")
public class StorageController {
    @Resource
    private StorageService storageService;

    @GetMapping("/list")
    public ResponseResult<PageInfo<StorageVo>> auditList(@RequestParam(value = "pageNum" ,required = false) Integer pageNum,
                                                         @RequestParam(value = "pageSize" ,required = false) Integer pageSize,
                                                         @RequestParam(value = "storageNo",required = false)String storageNo){

        return  ResponseResult.success(storageService.storageList(pageNum,pageSize, storageNo));
    }


    @PostMapping("/save")
    public ResponseResult<Integer> saveAudit(@RequestBody StorageQo storageQo){
        return ResponseResult.success(storageService.saveStorage(storageQo));
    }
    @PostMapping("/edit")
    public ResponseResult<Integer> editAudit(@RequestBody StorageQo storageQo){
        return ResponseResult.success(storageService.modifyStorage(storageQo));
    }


}
